object SeriesSum {
  def main(args: Array[String]): Unit = {
    var sum = 0.0
    var term = 1.0
    var n = 1

    while (term >= 1e-6) {
      term = 1.0 / (n * n)
      sum += term
      n += 1
    }

    println(s"公式1 + 1/2² + 1/3² + ... 的和为：$sum")
  }
}